package com.cby.jetpack.sample.binding

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.cby.jetpack.sample.databinding.ActivityDataBindMainBinding
import com.cby.jetpack.sample.ext.binding
import com.cby.jetpack.sample.ext.start

/**
 * @description: DataBindMainActivty
 *
 * @author ChenBaoyang
 * @date 8/11/21 14:54
 */
class DataBindMainActivity : AppCompatActivity(){

    private val binding: ActivityDataBindMainBinding by binding()

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding.btnDataBinding.setOnClickListener {
            start(TestDataBindingActivity::class.java)
        }

        binding.btnDataBinding2.setOnClickListener {
            start(TestDataBinding2Activity::class.java)
        }

        binding.btnDataBinding3.setOnClickListener {
            start(TestDataBinding3Activity::class.java)
        }

        binding.btnDataBindingList.setOnClickListener {
            start(TestDataBindingListActivity::class.java)
        }

        binding.btnDataBindingAdapter.setOnClickListener {
            start(TestDataBindingAdapterActivity::class.java)
        }

        binding.btnDataBindingListener.setOnClickListener {
            start(TestDataBindingListenerActivity::class.java)
        }

        binding.btnDataBindingConverter.setOnClickListener {
            start(TestDataBindingConverterActivity::class.java)
        }

        binding.btnDataBindingTwoWay.setOnClickListener {
            start(TestDataBindTwoWayActivity::class.java)
        }
    }
}